package 设计模式;


public class SingletonDemo3 {

    private static SingletonDemo3 instance = null;

    private SingletonDemo3(){}

    public static synchronized SingletonDemo3 getInstance(){
        if(instance==null){
            instance = new SingletonDemo3();
        }
        return instance;
    }

}
